<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" th:href="@{/css/pintuer.css}">
    <link rel="stylesheet" th:href="@{/css/admin.css}">
    <script th:src="@{/js/jquery.js}"></script>
    <script th:src="@{/js/pintuer.js}"></script>
</head>
<body>

<div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 文件列表</strong> <a href="" style="float:right; display:none;">添加字段</a>
    </div>
    <div class="padding border-bottom">
        <ul class="search" style="padding-left:10px;">
            <li><a class="button border-main icon-plus-square-o" th:href="@{/fileManage/folderList(uid=${session.user.uid})}"> 上传文件</a></li>
            <li>
                <form method="post" th:action="@{'/fileManage/list/'+${session.user.uid}}" id="listform">
                    <!-- 用隐藏域保存页号 -->
                    <input type="hidden" name="currentPage" id="currentPage" value="1">
                    <input type="text" placeholder="请输入搜索关键字" name="keyword" class="input" th:value="${keyword}"
                           style="width:250px; line-height:17px;display:inline-block"/>
                    <a href="javascript:void(0)" class="button border-main icon-search" onclick="changePageNum(1)">
                        搜索</a>
                </form>
            </li>
        </ul>
    </div>
    <table class="table table-hover text-center">
        <tr>
            <th width="10%">文件编号</th>
            <th>原文件名</th>
            <th>文件类型</th>
            <th>上传时间</th>
            <th>文件大小</th>
            <th>所属文件夹</th>
            <th width="310">操作</th>
        </tr>
        <tr th:each="item:${pageInfo.list}">
            <td th:text="${item.fid}"></td>
            <td th:text="${item.filename}"></td>
            <td th:text="${item.fcontenttype}"></td>
            <td th:text="${#dates.format(item.fcreatedate,'yyyy-MM-dd HH:mm:ss')}"></td>
            <td th:text="${item.fsize}"></td>
            <td th:text="${item.tname}"></td>
        </tr>

        <tr>
            <td colspan="7">
                <span>当前页</span><span th:text="${pageInfo.pageNum}+'/'+${pageInfo.pages}"></span><span>总页数</span>
                <div class="pagelist">
                    <a href="javascript:void(0)" th:onclick="|changePageNum(${pageInfo.isFirstPage}?${pageInfo.navigateFirstPage}:${pageInfo.prePage})|">上一页</a>
                    <span th:each="pageNum:${pageInfo.navigatepageNums}">
                        <a th:text="${pageNum}" th:onclick="|changePageNum(${pageNum})|" href="javascript:void(0)"></a>
                    </span>
                    <a href="javascript:void(0)" th:onclick="|changePageNum(${pageInfo.isLastPage}?${pageInfo.navigateLastPage}:${pageInfo.nextPage})|">下一页</a>
                </div>
            </td>
        </tr>
    </table>
</div>

<script type="text/javascript">

    //搜索
    function changePageNum(pageNum) {
        $("#currentPage").val(pageNum);
        $("#listform").submit();
    }

    //单个删除
    function del(id, mid, iscid) {
        if (confirm("您确定要删除吗?")) {

        }
    }

</script>
</body>
</html>